<?php
	if ( ! defined( 'NV_IS_BAOCAO_ADMIN' ) )
	{
		die( 'Stop!!!' );
	}
	$page_title = $lang_module['example_add'];
	$add = 0;
	$error = "";
	if ( $nv_Request->get_int( 'add', 'post' ) == 1 )
	{
		$title = filter_text_input( 'title', 'post', '', 1 );
		if ( empty( $title ) )
		{
			$error = $lang_module['err_title'];
		}
		else
		{
			$query = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "` (`id`, `title`) VALUES (NULL, " . $db->dbescape( $title ) . ")";
			if ( $db->sql_query_insert_id( $query ) )
			{
				$db->sql_freeresult();
				Header( "Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "" );
				die();
			}
			else
			{
			}
		}
	}
	$error = $lang_module['errorsave'];
	$error = "";
	if ( $error != "" )
	{
		$contents .= "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "` (`id`, `title`) VALUES (NULL, " . $db->dbescape( $title ) . ")";
		$contents .= "<div class=\"quote\" style=\"width:780px;\">\n";
		$contents .= "<blockquote class=\"error\"><span>" . $error . "</span></blockquote>\n";
		$contents .= "</div>\n";
		$contents .= "<div class=\"clear\"></div>\n";
	}
	$contents .= "<form action=\"" . NV_BASE_ADMINURL . "index.php\" method=\"POST\">\n";
	$contents .= "<table class=\"tab1\">\n";
	$contents .= "  <tr>\n";
	$contents .= "  <td width=\"30%\"><strong>" . $lang_module['title'] . "<strong></td>\n";
	$contents .= "  <td>\n";
	$contents .= "  <input type=\"text\" name=\"title\" size=\"100\">\n";
	$contents .= "  </td>\n";
	$contents .= "  </tr>\n";
	$contents .= "</table>\n";
	$contents .= "<table class=\"tab2\" align=\"center\">\n";
	$contents .= "  <tr>\n";
	$contents .= "  <td style=\"text-align:center;\">\n";
	$contents .= "  <input type=\"submit\" value=\"" . $lang_module['save'] . "\"/>\n";
	$contents .= "  <input name=\"add\" type=\"hidden\" value=\"1\" />\n";
	$contents .= "  <input type=\"hidden\" name =\"" . NV_NAME_VARIABLE . "\"value=\"" . $module_name . "\" />";
	$contents .= "  <input type=\"hidden\" name =\"" . NV_OP_VARIABLE . "\"value=\"" . $op . "\" />";
	$contents .= "  </td>\n";
	$contents .= "  </tr>\n";
	$contents .= "</table>\n";
	$contents .= "</form>\n";
	include ( NV_ROOTDIR . "/includes/header.php" );
	echo nv_admin_theme( $contents );
	include ( NV_ROOTDIR . "/includes/footer.php" );
?>